const error = "You are not authorized to work on this form for "+ data.employee.username +".<br>"Ask your admin for access."
This shows perfectly like this:
You are not authorized to work on this form for <username>.
Ask your admin for access.
so the <br> command is recognized. But when adding <b> to make the username bold it doesn't work. I tried putting it inside and outside the quotation marks and all, no luck.
Please assist, thank you!
Hey Damon, just so I can understand what your trying to do, where exactly are you entering this calculation? and how is the output of this calculation being displayed? (e.g. what components are you using)
Hey Damon, just so I can understand what your trying to do, where exactly are you entering this calculation? and how is the output of this calculation being displayed? (e.g. what components are you using)
Oh right sorry. So, the message is generated in a hidden component based on a few if-clauses and saved in a const and passed over as the hidden field's value:
if (condition){
const message = "You are not authorized to work on this form for "+ data.employee.username +".<br>"Ask your admin for access."
}
value = message;
the content field only holds the link {{data.message}}.
the page breaks via <br> work, but I don't know how to add formatting with <b>.
I was able to get this to work just fine (see image below)
When trying to use the JavaScript you included above, I noticed that you opened a pair of double quotes without closing it. I would suggest removing this here and trying again.
Please also note that it's pretty common to forget to enable the "Refresh on Change " property when setting the content component dynamically. I recommend checking you have enabled this.
As a side note, it might be worth considering using the content component with dynamic fields and then conditionally hiding and showing the component.
This might be a simpler approach then using a hidden component to set the content components with custom HTML.
Thank you very much for this Anthony!
We also get this to work, no problem. We just don't understand how we format parts of the content bold. <br> works without problems, but <b> doesn't work.
Sorry Damon, I might have misunderstood your original question. To use bold text you will need to both open and close the html <b> tags. For example:
value = "<b> This is bold </b> but this is not"
Hi Damon,
Yep, the above example works fine for me. I suspect you missed something like closing the </b> tag.
Here's a screen shot for your reference. If you are not so familiar with HTML it might be a better option to use the content component with dynamic fields as described above.